﻿using System;
using System.Diagnostics.Contracts;
using Adalbertus.BudgetPlanner.Domain;
using Adalbertus.BudgetPlanner.Domain.Repositories;

namespace Adalbertus.BudgetPlanner.Services.CodeContracts
{
    [ContractClassFor(typeof(ICashFlowService))]
    public abstract class ICashFlowServiceContract : BaseService<CashFlow>, ICashFlowService
    {
        protected ICashFlowServiceContract(IRepositoryFactory repositoryFactory, IUnitOfWorkProvider unitOfWorkProvider)
            : base(repositoryFactory, unitOfWorkProvider)
        {
        }

        public CashFlow Create(string name, string description)
        {
            Contract.Requires(!string.IsNullOrWhiteSpace(name));
            Contract.Ensures(Contract.Result<CashFlow>() != null);
            Contract.Ensures(Contract.Result<CashFlow>().Name.Equals(name));
            Contract.Ensures(Contract.Result<CashFlow>().Description == description);

            throw new NotImplementedException();
        }
    }
}
